<div class="pagination">
    {% spaceless %}
        <ul>
            <li class="prev{% if page.number == 1 %} disabled{% endif %}"><a href="?page=1">{{ txt_first_page|default:"&laquo;" }}</a></li>
            {% for p in page.paginator.page_range %}
                {% if p|add:5 >= page.number and p|add:-5 <= page.number %}
                    <li{% if p == page.number %} class="active"{% endif %}><a href="?page={{ p }}">{{ p }}</a></li>
                {% endif %}
            {% endfor %}
            <li class="next{% if page.number == page.paginator.num_pages %} disabled{% endif %}"><a href="?page={{ page.paginator.num_pages }}">{{ txt_last_page|default:"&raquo;" }}</a></li>
        </ul>
    {% endspaceless %}
</div>
